package com.zhuangfei.hpuhelper.tools;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

import android.content.Context;

import com.zhuangfei.hpuhelper.bean.PhoneBean;

public class AssetTools {

	public static String readText(Context context,String fileName){
		String content="";
		try {
			InputStreamReader is=new InputStreamReader(context.getAssets().open(fileName), "UTF-8");
			BufferedReader reader = new BufferedReader(is);
			String lineTxt = null;
			while ((lineTxt = reader.readLine()) != null) {
				content+=lineTxt;
			}
			reader.close();
			is.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return content;
	}
	
}
